﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;
using DIST.LR.ZHJG.WCFServices.EntityDataManageService;
using DIST.LR.ZHJG.Events;
using DIST.LR.ZHJG.DataModel;

namespace DIST.LR.ZHJG.Pgybc
{
    public partial class Zbgl_Tree : UserControl
    {
        public Zbgl_TreeModel viewmodel;
        public Zbgl_Tree()
        {
            InitializeComponent();
            viewmodel = new Zbgl_TreeModel();
            this.DataContext = viewmodel;
        }
        /// <summary>
        /// 指标树选中指标触发事件
        /// </summary>
        private void radTreeView_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangedEventArgs e)
        {
            if (e.AddedItems.Count > 0)
            {
                KPI zbglkpiModel = e.AddedItems[0] as KPI;
                if (zbglkpiModel != null)
                {
                    //发送消息
                    EventAggregatorRepository.EventAggregator
                    .GetEvent<RadTreeSelectChangeEvent>()
                    .Publish(zbglkpiModel);
                }
            }
        }
    }
}
